home *** CD-ROM | disk | FTP | other *** search
- package java.awt;
-
- import java.awt.peer.FileDialogPeer;
- import java.io.FilenameFilter;
- import ms.applet.AppletSecurity;
-
- public class FileDialog extends Dialog {
- public static final int LOAD = 0;
- public static final int SAVE = 1;
- int mode;
- String dir;
- String file;
- FilenameFilter filter;
-
- public FileDialog(Frame var1, String var2) {
- this(var1, var2, 0);
- }
-
- public FileDialog(Frame var1, String var2, int var3) {
- super(var1, var2, true);
- if (System.security instanceof AppletSecurity) {
- AppletSecurity var4 = (AppletSecurity)System.security;
-
- try {
- var4.checkAccessToFileDialog();
- } catch (SecurityException var6) {
- ((Throwable)var6).printStackTrace();
- System.err.println("FileDialog Security Violation. Throwing SecurityException...");
- throw new SecurityException();
- }
- }
-
- this.mode = var3;
- ((Container)this).setLayout((LayoutManager)null);
- }
-
- public synchronized void addNotify() {
- super.peer = ((Window)this).getToolkit().createFileDialog(this);
- super.addNotify();
- }
-
- public int getMode() {
- return this.mode;
- }
-
- public String getDirectory() {
- return this.dir;
- }
-
- public void setDirectory(String var1) {
- this.dir = var1;
- if (super.peer != null) {
- ((FileDialogPeer)super.peer).setDirectory(var1);
- }
-
- }
-
- public String getFile() {
- return this.file;
- }
-
- public void setFile(String var1) {
- this.file = var1;
- if (super.peer != null) {
- ((FileDialogPeer)super.peer).setFile(var1);
- }
-
- }
-
- public FilenameFilter getFilenameFilter() {
- return this.filter;
- }
-
- public void setFilenameFilter(FilenameFilter var1) {
- this.filter = var1;
- FileDialogPeer var2 = (FileDialogPeer)super.peer;
- if (var2 != null) {
- var2.setFilenameFilter(var1);
- }
-
- }
-
- protected String paramString() {
- String var1 = super.paramString();
- if (this.dir != null) {
- var1 = var1 + ",dir= " + this.dir;
- }
-
- return var1 + (this.mode == 0 ? ",load" : ",save");
- }
- }
-